/**
 * 
 */
package agents.persons.leader;

import jade.core.Agent;
import jade.core.behaviours.FSMBehaviour;

/**
 * @author Elena
 *
 */
public class LeaderFSMBehaviour extends FSMBehaviour{
	
    // FSM states 
    private static final String SD_STATE = "SDB"; //Buscar Dependientes
    private static final String GSP_STATE = "GSP"; //Ir a lugar seguro
    private static final String SSP_STATE = "SSP";//Permanecer en Lugar Seguro 
    private static final String ERROR_STATE = "error"; 

    // behaviour return values (from each onEnd() method 
    public static final int SEARCHED = 0; 
    public static final int ARRIVED = 5; 
    public static final int PLS = 10; 
    public static final int ERROR = -1; 

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public LeaderFSMBehaviour(Agent a){
		super(a);
		// register state behaviours 
		registerFirstState(new SearchDependentsBehaviour(a), SD_STATE);
		registerState(new Go2SafePlaceBehaviour(a,202), GSP_STATE);
		registerLastState(new StaySafePlaceBehaviour(a), SSP_STATE);
		
		// transitions of the FSM
		registerTransition(SD_STATE, GSP_STATE, SEARCHED);
		registerTransition(GSP_STATE,SSP_STATE,ARRIVED);
		
		scheduleFirst(); 
	}
	



}
